package concurrent.chapter6;

/**
 * ReadWriteLock design pattern
 * Reader-Writer design pattern
 */
//18讲、多线程读写锁分离设计模式讲解
public class ReadWriteLockClient {
    public static void main(String[] args) {
        final SharedData sharedData = new SharedData(10);
        new ReaderWorker(sharedData).start();
        new ReaderWorker(sharedData).start();
        new ReaderWorker(sharedData).start();
        new ReaderWorker(sharedData).start();
        new ReaderWorker(sharedData).start();
        new WriterWorker(sharedData, "qwertyuiopadfg").start();
        new WriterWorker(sharedData, "QWERTYUIOPADFG").start();
    }
}
